/**
 * @project Textoo
 * @author Bertrand Larrieu - lab9
 * @mail lab9.fr@gmail.com
 * @timestamp 17/10/2011 18:15
 * @version 0.1
 */

package  
{
	import flash.geom.Point;
	import flash.geom.Rectangle;
	import org.looty.textoo.render.TextFieldLetter;

	public class MovingTextFieldLetter extends TextFieldLetter implements IMovingLetter
	{
		
		private var _distance		:Number;
		
		private var _vect		:Point;
		
		public function MovingTextFieldLetter() 
		{
			var angle:Number = Math.random() * Math.PI * 2;
			_vect = new Point(Math.cos(angle), Math.sin(angle));
			_distance = 0;
		}
		
		public function get distance():Number 
		{
			return _distance;
		}
		
		public function set distance(value:Number):void 
		{
			_distance = value;
			x = position.x + _vect.x * _distance;
			y = position.y + _vect.y * _distance;
		}
		
		
		
	}

}